let axios = require("axios");
let fs = require("fs");
let JsonFormat = require("json-format");

(async () => {
    let res = await axios.get("https://bbs-api.mihoyo.com/post/wapi/getForumPostList?forum_id=29",{
        headers: {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/605.1.15 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36',  // 2.11.1
        }
    })

    console.log(res);
    if(res.data) {
        fs.writeFileSync("./index.js", JsonFormat(res.data))
    }
})()